/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

/*
 * Copyright (c) 2015, Joyent, Inc.
 */

@import "__vms-list";

.servers-list {
  .server-list-header {
    .__vms-list.vms-list-header;
    .select {
      padding-left: 4px;
      width: auto;
    }
  }

  .zero-state {
    text-align: center;
    display: block;
  }

  .servers-list-item:last-child {
    margin-bottom: 0;
  }


  .servers-list-item {
    .make-row(0);
    background: #fff;
    padding: 0;

    .traits {
      margin-top: 4px;
      font-size: 9px;

      .headnode {
        background: #000;
      }

      span+span {
        margin-left: 2px;
      }

      span {
        text-transform: uppercase;
        color: #FFF;
        padding: 2px 4px;
        background: #666;
      }

    }

    margin-bottom: 10px;
    overflow: hidden;
    .requires-setup {
      .alert-warning;
    }

    .select {
      float: left;
      width: 20px;
      padding-left: 4px;
      line-height: 80px;
    }

    .status {
      float: left;
      width: 20px;
      height: 80px;
      &.running { background: @brand-success; }
      &.rebooting { background: @brand-warning; }
      &.unavailable { background: @brand-danger;}
      &.unknown { background: @brand-danger;}
      &.un-reserve { background: @brand-success; }
    }

    .data {
      .make-row(0);
      margin-left: 20px;
    }
    .data.has-select {
      margin-left: 40px;
    }
    .setup-status {
      .make-xs-column(4);
      margin-top: 20px;
      font-size: 14px;
      .setup { }
      padding: 5px;
      text-align: center;
      button {
        margin-left: 20px;
      }
    }

    .name {
      .make-sm-column(4);
      padding: 10px;
    }

    a { cursor: pointer; }


    .memory-usage {
      .make-sm-column(5);

      .memory-usage-total {
        color: @gray-light;
        font-size: 12px;
        text-transform: uppercase;
        text-align: right;
        padding: 5px 0;
        strong {
          font-weight: 200;
          color: @gray;
          font-weight: 100;
          letter-spacing: 1px;
          text-transform: uppercase;
          padding: 0 5px;
        }
        span {
          font-weight: 400;
        }
      }
      .provisioning-state {
        color: @gray-light;
        font-size: 12px;
        text-transform: uppercase;
        text-align: right;
        strong {
          font-weight: 200;
          color: @gray;
          font-weight: 100;
          letter-spacing: 1px;
          text-transform: uppercase;
          padding: 0 5px;
        }
        span {
          font-weight: 400;
          text-transform: capitalize;
        }
        .disabled {
          #page-server.disabled
        }
        .enabled {
          #page-server.enabled
        }
      }
      .memory-usage-avail {
        font-size: 12px;
        text-align: right;

        strong {
          color: @gray;
          font-weight: 100;
          letter-spacing: 1px;
          text-transform: uppercase;
          padding: 0 5px;
        }

        .avail { color: #00d295; }
        font-weight: 400;
      }

      .memory-usage-data {
        float: right;
        margin-right: 15px;
        margin-top: 10px;
      }
      .memory-usage-graph-container {
        width: 80px;
        height: 80px;
        float: right;
        margin-right: 15px;
      }
    }

    .last-status {
      .make-sm-column(3);
      padding: 15px;
      font-size: 12px;
      i { padding: 0 4px; }
      strong { font-weight: normal; text-transform: uppercase; padding-right: 8px; color: @gray-light;}
    }

    .last-boot { color: @gray;}
    .last-heartbeat { color: @gray; }
    .last-platform {
      .platform {
        background: #f3f3f3;
      }
    }

    .reserved {
      margin-left: 10px;
      background: @state-warning-bg;
    }
  }

  .uuid {
    font-size: 10px;
    line-height: 14px;
    color: @gray-light;
    font-style: italic;
    display: block;
    width: 280px;
    font-family: monospace;
  }
  
  .state {
    font-size: 10px;
    padding: 4px 6px;
    text-transform: uppercase;
    &.stopped { background-color: @gray-light; color: #fff; }
    &.failed, &.reserve { background-color: @brand-danger; color: #fff; }
    &.running, &.un-reserve { background-color: @brand-success; color: #fff; }
    &.destroyed { background-color: @gray-dark; color: #fff; }
  }
}
